/*FILE: BighoofAIOFurnaceBasic.java
 *Bighoof AIO Furnace Basic, by BobbyBighoof, Version 1.0 (01-29-2010)
 *
 * version 1.18 - (11-21-2010) fix for cannonball math for new interfaces in game.
 *
 * version1.17 - (10-20-2010) fix for all bars as the make bar math changed messing up
 * the amount set for the make X that was i nthe math. Should be working for all
 * bars now. Still no cannon ball math that will be coming soon.
 *
 * version 1.16 - (10-13-2010) Updated the script to comply with the 623 interface
 * changes for smithing. 1.17 will have to be for cannon balls I do not at this time
 * have an account ot check that math but will i nthe near future.
 *
 * version 1.15 - (07-02-2010) cleaned up code, fixed cannonball smelting, fixed
 * log out when out of items to use to work with on cannonballs and crafting, Cleaned
 * up the handle bank math to reflect new math set by zzSleepzz :) thanks zz.
 *
 * version 1.14 - (02-28-2010) added some wait time to both item withdraws. Changed
 * iron withdraw to be withdraw-10 instead of 9 to try and combat text spam in chat
 *
 *
 *Thanks to: zzSleepzz for helping push me in the right direction.
 *Thanks to: idontPLAYrs my always valued alpha and closed bata tester, also my
 *idea and chat about it guy :) glad to have you on my team dude.
 */

import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Point;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.net.URL;
import java.util.Map;

import javax.imageio.ImageIO;

import org.rsbot.bot.Bot;
import org.rsbot.client.input.Mouse;
import org.rsbot.event.events.MessageEvent;
import org.rsbot.event.listeners.PaintListener;
import org.rsbot.event.listeners.MessageListener;
import org.rsbot.script.Constants;
import org.rsbot.script.Script;
import org.rsbot.script.ScriptManifest;
import org.rsbot.script.Skills;
import org.rsbot.script.wrappers.RSInterfaceChild;
import org.rsbot.script.wrappers.RSObject;
import org.rsbot.script.wrappers.RSTile;

@ScriptManifest(authors = {"BobbyBighoof"},
category = "Smithing",
name = "Bighoof AIO FurnaceBasic",
email = "runedev.info",
version = 1.18,
description = "<style type='text/css'>"
+ "body {background:url('http://bighoofscripts.webs.com/images/back-1.jpg') repeat}"
+ "</style><html><head><center><img src=\"http://bighoofscripts.webs.com/images/aiof/hoof-aiofurn.jpg\">"
+ "</center></head>"
+ "<center><div style=width: 100%; padding: 0px; padding-bottom: 2px; background-color: #e4c674>"
+ "<table style=border-collapse:collapse cellpadding=0 cellspacing=0><tr>"
+ "<td class=style2 align=right bgcolor=#00FFFF><b>Paint ,"
+ "</b></td><td class=style1 bgcolor=#00FFFF><b>Options"
+ "</b></td></tr><tr><td class=style2 bgcolor=#C0C0C0 color=#000000>"
+ "Image Themes:"
+ "</td><td class=style2 bgcolor=#C0C0C0 color=#000000>"
+ "<select name=theme><option selected>None<option>RS Basic<option>Micro Window"
+ "<option>The Bigbomb<option>Rustolium</select></td></tr><br><tr>"
+ "<td class=style2 align=right bgcolor=#00FFFF><b>Item ,"
+ "</b></td><td class=style1 bgcolor=#00FFFF><b>Options"
+ "</b></td></tr><tr><td class=style2 bgcolor=#C0C0C0 color=#000000>"
+ "Use Gold Gauntlets:"
+ "</td><td class=style1 bgcolor=#C0C0C0 color=#000000>"
+ "<INPUT TYPE=checkbox name=goldGloves VALUE=true>Yes"
+ "</td></tr><tr><td class=style2 align=right bgcolor=#00FFFF>"
+ "<b>Make ,</b></td><td class=style1 bgcolor=#00FFFF><b>Options"
+ "</b></td></tr><tr><td class=style2 bgcolor=#C0C0C0 color=#000000>"
+ "Smithing:"
+ "</td><td align=left class=style1 bgcolor=#C0C0C0 color=#000000>"
+ "<select name=stype><option selected>None</option><option>Bronze Bar<option>Blurite Bar"
+ "<option>Iron Bar<option>Silver Bar<option>Steel Bar<option>Gold Bar<option>Mithril Bar"
+ "<option>Adamantite Bar<option>Runite Bar<option>Cannon Ball</select>"
+ "</td></tr><tr><td class=style2 bgcolor=#C0C0C0 color=#000000>"
+ "Crafting"
+ "</td><td align=left class=style1 bgcolor=#C0C0C0 color=#000000>"
+ "<select name=ctype><option>None<option>Gold Ring<option>Gold Necklace"
+ "<option>Gold Amulet<option>Gold Bracelet<option>Sapphire Ring<option>"
+ "Sapphire Necklace<option>Sapphire Amulet<option>Sapphire Bracelet<option>"
+ "Emerald Ring<option>Emerald Necklace<option>Emerald Amulet<option>"
+ "Emerald Bracelet<option>Ruby Ring<option>Ruby Necklace<option>Ruby Amulet"
+ "<option>Ruby Bracelet<option>Diamond Ring<option>Diamond Necklace<option>"
+ "Diamond Amulet<option>Diamond Bracelet<option>Dragonstone Ring<option>"
+ "Dragonstone Necklace<option>Dragonstone Amulet<option>Dragonstone Bracelet"
+ "<option>Tiara<option>Unstrung Symbol<option>Silver Bolts (unf)</select>"
+ "</td></tr><tr><td class=style2 align=right bgcolor=#00FFFF><b>Location ,"
+ "</b></td><td class=style1 bgcolor=#00FFFF><b>Options"
+ "</b></td></tr><tr><td class=style2 bgcolor=#C0C0C0 color=#000000>"
+ "Location:"
+ "</td><td align=left class=style1 bgcolor=#C0C0C0 color=#000000>"
+ "<select name=location><option>Falador<option selected>Al Kharid"
+ "<option>Edgeville<option>Neitiznot</select>"
+ "</tr></tr><tr><td class=style2 bgcolor=#C0C0C0 color=#000000>"
+ "Amount:"
+ "</td><td class=style1 bgcolor=#C0C0C0 color=#000000>"
+ "<input type=text name=amount id=amount size=16 value=1000000>"
+ "</td></tr><tr><td class=style2 align=right bgcolor=#00FFFF><b>Speed ,"
+ "</b></td><td class=style1 bgcolor=#00FFFF><b>Options"
+ "</b></td></tr><tr><td class=style2 bgcolor=#C0C0C0 color=#000000>"
+ "Use Rest:"
+ "</td><td class=style1 bgcolor=#C0C0C0 color=#000000>"
+ "<INPUT TYPE=checkbox name=restSet VALUE=true>Yes"
+ "</b></td></tr><tr><td class=style2 bgcolor=#C0C0C0 color=#000000>"
+ "Mouse Speed:"
+ "</td><td class=style1 bgcolor=#C0C0C0 color=#000000>"
+ "<select name=speed><option>Slow<option selected>Human<option>Fast</select>"
+ "</td></tr><tr><td class=style2 bgcolor=#C0C0C0 color=#000000>"
+ "Script Speed:"
+ "</td><td align=left class=style1 bgcolor=#C0C0C0 color=#000000>"
+ "<select name=wait><option>Slow<option selected>Human<option>Fast</select>"
+ "</td></tr></table></center></body></html>")
public class BighoofAIOFurnaceBasic extends Script implements PaintListener,
        MessageListener {

    private final ScriptManifest properties = getClass().getAnnotation(ScriptManifest.class);
    private final RSTile[] FSmithPath = {new RSTile(2951, 3379),
        new RSTile(2961, 3380), new RSTile(2971, 3378), new RSTile(2973, 3373),
        new RSTile(2974, 3369)};
    private final RSTile[] FSmithing = cleanPath(fixPath(FSmithPath));
    private final RSTile[] FBankPath = {new RSTile(2965, 3377),
        new RSTile(2956, 3381), new RSTile(2951, 3380), new RSTile(2950, 3376),
        new RSTile(2945, 3371), new RSTile(2947, 3368)};
    private final RSTile[] FBanking = cleanPath(fixPath(FBankPath));
    RSTile[] FDoor = {new RSTile(0000, 0000)};
    private final RSTile[] ASmithPath = {new RSTile(3276, 3173),
        new RSTile(3276, 3184)};
    private final RSTile[] ASmithing = cleanPath(fixPath(ASmithPath));
    private final RSTile[] ABankPath = {new RSTile(3276, 3173),
        new RSTile(3269, 3169)};
    private final RSTile[] ABanking = cleanPath(fixPath(ABankPath));
    private final RSTile[] ESmithPath = {new RSTile(3098, 3496),
        new RSTile(3108, 3500)};
    private final RSTile[] ESmithing = cleanPath(fixPath(ESmithPath));
    private final RSTile[] EBankPath = {new RSTile(3108, 3500),
        new RSTile(3098, 3496)};
    private final RSTile[] EBanking = cleanPath(fixPath(EBankPath));
    private final RSTile[] NSmithPath = {new RSTile(2338, 3807),
        new RSTile(2343, 3810)};
    private final RSTile[] NSmithing = cleanPath(fixPath(NSmithPath));
    private final RSTile[] NBankPath = {new RSTile(2343, 3810),
        new RSTile(2338, 3807)};
    private final RSTile[] NBanking = cleanPath(fixPath(NBankPath));
    private final RSTile[] PSmithPath = {new RSTile(3686, 3479)};
    private final RSTile[] PSmithing = cleanPath(fixPath(PSmithPath));
    private final RSTile[] PBankPath = {new RSTile(3689, 3473)};
    private final RSTile[] PBanking = cleanPath(fixPath(PBankPath));
    RSTile[] PDoor = {new RSTile(0000, 0000)};
    RSTile[] OpenDoor;
    private RSTile[] Banking;
    private RSTile[] Smithing;
    private BufferedImage img = null;
    //SYSTEM INTS
    private int BankBooth;
    private int Furnace;
    public int smithingXP;
    private int Rested;
    private int makeSet = 0;
    private int Child;
    private int spee;
    private int amount;
    public int logCount;
    private int trips = 0;
    private static final int wait1 = 0;
    private int wait2 = 0;
    private int wait3 = 0;
    private int wait4 = 0;
    private int wait5 = 0;
    private int wait6 = 0;
    private int wait7 = 0;
    private int wait8 = 0;
    private int wait9 = 0;
    private int wait10 = 0;
    public int paints = 0;
    private int Theme;
    private int restSet = 0;
    private int BarCount = 0;
    private int Ore1;
    private int Ore2;
    private int Ore1Amount;
    private int Ore2Amount;
    private int BarAmount;
    private int BarID;
    private int geAmount;
    public int ant;
    private int startXP;
    private int startLVL;
    private int mouldID;
    private int salesGE;
    private int madeID;
    private int mould = 0;
    private int X;
    private int Y;
    private int face = 0;
    private int Barxp;
    //SYSTEM DOUBLES
    private static final double B0 = 8;
    private static final double B1 = 6.2;
    private static final double B2 = 12.5;
    private static final double B3 = 13.7;
    private static final double B4 = 17.5;
    private static final double B5 = 22.5;
    private static final double B6 = 30;
    private static final double B7 = 37.5;
    private static final double B8 = 50;
    private static final double B51 = 56.2;
    private static final double B10 = 6.4375;
    private static final double B01 = 15;
    private static final double B02 = 20;
    private static final double B03 = 25;
    private static final double B04 = 40;
    private static final double B05 = 55;
    private static final double B06 = 60;
    private static final double B07 = 65;
    private static final double B08 = 70;
    private static final double B09 = 75;
    private static final double B010 = 80;
    private static final double B011 = 85;
    private static final double B012 = 90;
    private static final double B013 = 95;
    private static final double B014 = 100;
    private static final double B015 = 105;
    private static final double B016 = 110;
    private static final double B017 = 150;
    static final double B018 = 115;
    static final double B019 = 120;
    static final double B020 = 125;
    static final double B021 = 165;
    private static final double B022 = 52.5;
    private String BarName;
    private String ClickName;
    private String OreName1;
    private String OreName2;
    private String mouldName;
    private String status = ("Loading...");
    private long scriptStartTime;
    private boolean setAltitude = false;

    @Override
    protected int getMouseSpeed() {
        return random(1 + spee, 2 + spee);
    }

    void moveMousesSlightly() {
        final int x = random(0, 300);
        final int y = random(0, 200);
        mouse.move(x, y, 10, 10);
        wait(random(wait8, wait9));
        mouse.move(x, y, 5, 5);
        wait(random(wait8, wait9));
        mouse.move(x, y, 2, 2);
    }

    void moveMouses() {
        final int x = random(0, 750);
        final int y = random(0, 500);
        mouse.move(x, y, 10, 10);
        wait(random(wait8, wait9));
        mouse.move(x, y, 5, 5);
    }

    void moveCamera() {
        int angle = getCameraAngle() + random(-90, 90);
        if (angle < 0) {
            angle = 0;
        }
        if (angle > 359) {
            angle = 0;
        }
        setCameraRotation(angle);
    }

    void moveCameraSlightly() {
        int angle = getCameraAngle() + random(-45, 45);
        if (angle < 0) {
            angle = 0;
        }
        if (angle > 359) {
            angle = 0;
        }
        setCameraRotation(angle);
    }

    void antiBan() {
        switch (random(0, 10000)) {
            case 1:
                if (getCurrentTab() != Constants.TAB_STATS) {
                    status = ("Performing AntiBan...");
                    openTab(Constants.TAB_STATS);
                    wait(random(wait5, wait6));
                    mouse.move(688, 281, 5, 5);
                    wait(random(wait8, wait9));
                } else {
                    if (getCurrentTab() == Constants.TAB_STATS) {
                        status = ("Performing AntiBan...");
                        openTab(Constants.TAB_INVENTORY);
                        wait(random(wait8, wait9));
                    }
                }
                break;
            case 2:
                status = "Performing AntiBan...";
                moveCameraSlightly();
                break;
            case 3:
                status = ("Performing AntiBan...");
                mouse.moveRandomly(300);
                break;
            case 4:
                status = "Performing AntiBan...";
                moveCamera();
                break;
            case 5:
                if (getCurrentTab() != Constants.TAB_INVENTORY) {
                    status = ("Performing AntiBan...");
                    openTab(Constants.TAB_INVENTORY);
                    wait(random(wait5, wait6));
                    mouse.move(582, 229, 5, 5);
                    wait(random(wait8, wait9));
                    openTab(Constants.TAB_STATS);
                    wait(random(wait5, wait6));
                    mouse.move(680, 280, 5, 5);
                    wait(random(wait8, wait9));
                } else {
                    if (getCurrentTab() == Constants.TAB_STATS) {
                        status = ("Performing AntiBan...");
                        openTab(Constants.TAB_STATS);
                        wait(random(wait5, wait6));
                        mouse.move(680, 280, 5, 5);
                        wait(random(wait7, wait9));
                    }
                }
                break;
            case 6:
                status = ("Performing AntiBan...");
                moveMouses();
                break;
            case 7:
                status = "Performing AntiBan...";
                moveMousesSlightly();
                break;
        }
    }

    public void messageReceived(final MessageEvent e) {
        final String message = e.getMessage();
        if (message.contains("to make that.")) {
            stopScript();
        }
        if (message.contains("You remove the cannonballs from the mould")) {
            status = ("Smelted 4 " + BarName + "s...");
            BarCount += 4;
        }

        if (message.contains("The magic of the Varrock armour enables "
                + "you to smelt 2 bars at the same time")) {
            status = ("Smelted a " + BarName + " Bar...");
            BarCount++;
        }

        if (message.contains("You retrieve a bar")) {
            status = ("Smelted a " + BarName + " Bar...");
            BarCount++;
        }

        if (message.contains("You have run out of")) {
            status = ("Out Of Ore...");
            trips++;
        }
    }

    void run() {
        if (getEnergy() > 40 + random(1, 60)
                || getEnergy() > 71) {
            wait(random(200, 300));
            setRun(true);
            wait(random(300, 500));
        }
    }

    void doRest() {
        if (isLoggedIn()) {
            if (restSet == 1) {
                if (getEnergy() < 10 + random(1, 10)
                        || getEnergy() < 15) {
                    status = ("Resting...");
                    rest(random(80, 100));
                    Rested++;
                }
            }
        }
    }

    @Override
    public void onFinish() {
        logProgressReport();
        return;
    }

    public int loop() {
        if (!isLoggedIn()) {
            return random(wait1, wait2);
        }

        if (BarCount > amount - 1) {
            status = ("Reached " + amount + ", "
                    + BarName + " Bars");
            stopScript();
            logout();
        }

        run();
        antiBan();

        if (!setAltitude) {
            setCameraAltitude(true);
            wait(random(wait5, wait6));
            setAltitude = true;
            return random(wait2, wait4);
        }

        if (makeSet == 0) {
            if (startXP == 0) {
                startXP = skills.getCurrentSkillExp(Skills.getStatIndex("smithing"));
                startLVL = skills.getCurrSkillLevel(Skills.getStatIndex("smithing"));
            }
        } else if (makeSet == 1) {
            if (startXP == 0) {
                startXP = skills.getCurrentSkillExp(Skills.getStatIndex("crafting"));
                startLVL = skills.getCurrSkillLevel(Skills.getStatIndex("crafting"));
            }
        }

        if (oreIDCheck()) {
            if (atBank()) {
                handleBank();
                handleWithdraw();
                return (1);
            } else {
                if (walkToBank());
                doRest();
                return (1);
            }
        } else {
            if (atFurnace()) {
                handleBars();
                return (1);
            } else {
                if (walkToFurnace());
                doRest();
                return (1);
            }
        }
    }

    boolean oreIDCheck() {//ORE CHECK
        status = ("Checking Inventory");
        return (!inventoryContains(Ore1)
                || (!inventoryContains(Ore2)));
    }

    boolean atBank() {
        status = ("Finding Bank");
        return (distanceTo(getNearestObjectByID(BankBooth)) < 6);
    }

    public boolean handleBank() {
        try {
            if (!bank.isOpen()) {
                if (bank.open()) {
                    int fail = 0;
                    while (!bank.isOpen()) {
                        fail++;
                        if (fail >= 30) {
                            return !bank.isOpen();
                        }
                        sleep(100);
                    }
                }
            }
        } catch (final Exception e) {
        }
        return bank.isOpen();
    }

    void handleWithdraw() {
        if (mould == 1) {
            wait(random(wait5, wait6));
            status = ("Checking For " + mouldName + " Mould...");
            if (getInventoryCount(mouldID) == 0) {
                if (bank.getCount(mouldID) > 0) {
                    wait(random(wait6, wait7));
                    status = ("Getting " + mouldName + " Mould...");
                    bank.withdraw(mouldID, 1);
                    wait(random(wait6, wait7));

                } else {
                    log("You do not have a " + mouldName + "mould. Stopping script...");
                    bank.close();
                    status = ("Logging Out...");
                    log("Logging out in 10 sec...");
                    wait(random(10000, 12000));
                    logout();
                    stopScript();
                }
            } else if (getInventoryCount(mouldID) > 1) {
                bank.depositAll();
                return;
            } else if (getInventoryCount(mouldID) == 1) {
                if (bank.isOpen()) {
                    wait(random(wait6, wait7));
                    status = ("Empting Inventory...");
                    if (bank.depositAllExcept(mouldID));
                    wait(random(wait6, wait7));
                    if (bank.getCount(Ore1) > 0) {
                        status = ("Checking " + OreName1 + "...");
                        wait(random(wait6, wait7));
                        if (getInventoryCount(Ore1) == 0) {
                            status = ("Getting " + OreName1 + "...");
                            wait(random(wait7, wait8));
                            if (madeID == 2
                                    || madeID == 1635
                                    || madeID == 1654
                                    || madeID == 1673
                                    || madeID == 11069) {
                                wait(random(300, 500));
                                status = ("Input Over Amount...");
                                if (bank.atItem(Ore1, "Withdraw-All"));
                                wait(random(wait7, wait8));
                            } else if (bank.atItem(Ore1, "Withdraw-" + Ore1Amount)) {
                                status = ("Input " + Ore1Amount + " As Amount...");
                                wait(random(wait6, wait7));
                            } else {
                                bank.atItem(Ore1, "Withdraw-X");
                                status = ("Input Amount...");
                                wait(random(wait8, wait9));
                                sendText(String.valueOf(Ore1Amount), true);
                                wait(wait10);
                            }
                        }
                        wait(random(wait2, wait3));
                        if (Ore2Amount != 0) {
                            wait(random(wait6, wait7));
                            if (bank.getCount(Ore2) > Ore2Amount) {
                                status = ("Checking" + OreName2 + "...");
                                wait(random(wait6, wait7));
                                if (getInventoryCount(Ore2) == 0) {
                                    status = ("Getting " + OreName2 + "...");
                                    wait(random(wait8, wait9));
                                    if (bank.atItem(Ore2, "Withdraw-" + Ore2Amount)) {
                                        status = ("Input Ore Amount...");
                                        wait(random(wait6, wait7));
                                        status = ("Path Set To Furnace...");
                                    } else {
                                        bank.atItem(Ore2, "Withdraw-X");
                                        status = ("Input Ore Amount...");
                                        wait(random(wait8, wait9));
                                        sendText(String.valueOf(Ore2Amount), true);
                                        status = ("Path Set To Furnace...");
                                    }
                                }
                            } else {
                                log("You have ran out of " + OreName1 + ". Stopping script...");
                                bank.close();
                                status = ("Logging Out...");
                                log("Logging out in 10 sec...");
                                wait(random(10000, 12000));
                                logout();
                                stopScript();
                            }
                        } else {
                            status = ("Path Set To Furnace...");
                        }
                    } else {//OUT OF ORE LOG OUT
                        log("You have ran out of " + OreName1 + ". Stopping script...");
                        bank.close();
                        status = ("Logging Out...");
                        log("Logging out in 10 sec...");
                        wait(random(10000, 12000));
                        logout();
                        stopScript();
                    }
                }
            } else {
                log("You do not have a mould. Stopping script...");
                bank.close();
                status = ("Logging Out...");
                log("Logging out in 10 sec...");
                wait(random(10000, 12000));
                logout();
                stopScript();
            }
        } else {
            if (mould == 0) {
                if (bank.isOpen()) {
                    wait(random(wait6, wait7));
                    status = ("Empting Inventory...");
                    if (bank.depositAll());
                    wait(random(wait6, wait7));
                    if (bank.getCount(Ore1) > Ore1Amount) {
                        status = ("Checking " + OreName1 + "...");
                        wait(random(wait6, wait7));
                        if (getInventoryCount(Ore1) == 0) {
                            status = ("Getting " + OreName1 + "...");
                            wait(random(wait7, wait8));
                            if (BarID == 9467
                                    || BarID == 2351
                                    || BarID == 2355
                                    || BarID == 2357) {
                                status = ("Input Over Amount...");
                                wait(random(300, 400));
                                if (bank.atItem(Ore1, "Withdraw-All"));
                            } else if (BarID == 2353) {
                                if (bank.atItem(Ore1, "Withdraw-10"));
                            } else if (bank.atItem(Ore1, "Withdraw-" + Ore1Amount)) {
                                status = ("Input " + Ore1Amount + " As Amount...");
                                wait(random(wait6, wait7));
                            } else {
                                bank.atItem(Ore1, "Withdraw-X");
                                status = ("Input Ore Amount...");
                                wait(random(wait8, wait9));
                                sendText(String.valueOf(Ore1Amount), true);
                                wait(wait10);
                            }
                        }
                    } else {
                        log("You have ran out of " + OreName1 + ". Stopping script...");
                        bank.close();
                        status = ("Logging Out...");
                        log("Logging out in 10 sec...");
                        wait(random(10000, 12000));
                        logout();
                        stopScript();
                    }
                    wait(random(wait2, wait3));
                    if (Ore2Amount != 0) {
                        wait(random(wait7, wait8));
                        if (bank.getCount(Ore2) > Ore2Amount) {
                            status = ("Checking" + OreName2 + "...");
                            wait(random(wait6, wait7));
                            if (getInventoryCount(Ore2) == 0) {
                                status = ("Getting " + OreName2 + "...");
                                wait(random(wait7, wait8));
                                if (bank.atItem(Ore2, "Withdraw-All")) {
                                    wait(random(wait7, wait9));
                                    status = ("Path Set To Furnace...");
                                }
                            }
                        } else {//OUT OF ORE LOG OUT
                            bank.close();
                            status = ("Logging Out...");
                            log("Logging out in 10 sec...");
                            wait(random(10000, 12000));
                            logout();
                            stopScript();
                        }
                    } else {
                        status = ("Path Set To Furnace...");
                    }
                }
            }
        }
    }

    boolean walkToBank() {// WALK PATH TO BANK
        if (distanceTo(getDestination()) <= random(8, 2)) {
            status = ("Going To Bank...");
            try {
                if (!walkPathMiniM(Banking, 12, 1, 1)) {
                    walkTo(nextTile(Banking, 12, false));
                }
            } catch (final Exception e) {
            }
        }
        return true;
    }

    boolean atFurnace() {
        status = ("Finding Furnace");
        return (distanceTo(objects.getNearestByID(Furnace)) < 12);
    }

    private boolean isSmelting() {
        int j = 0;
        for (int i = 0; i < 10
                && getInventoryCount(Ore1) >= 0; i++) {
            if (player.getMine().getAnimation() == 3243
                    || player.getMine().getAnimation() == 899
                    || player.getMine().getAnimation() == 827) {
                moveMousesSlightly();
                j = j + 1;
            }
            wait(random(150, 200));
        }

        if (j > 0) {
            if (makeSet == 1) {
                if (getInventoryCount(madeID) == BarAmount) {
                    BarCount += BarAmount;
                }
                return true;
            } else if (makeSet == 0) {
                return true;

            }
        } else {
        }
        return false;
    }

    void handleBars() {
        if (makeSet == 0) {
            if (face == 0) {
                final RSObject furnace = objects.getNearestByID(Furnace);
                if (!isSmelting()) {
                    status = ("Clicking Furnace...");
                    if (!getInterface(916).isValid()) {
                        int ct = 0;
                        if (Smithing == NSmithing) {
                            objects.at(furnace, "Smelt Clay forge");
                        } else {
                            objects.at(furnace, "Smelt Furnace");
                        }
                        while (!getInterface(916).isValid()) {
                            ct++;
                            if (ct >= 30) {
                                return;
                            }
                            sleep(100);
                        }
                        ct = 0;
                    } else if (getInterface(916).isValid()) {
                        wait(random(wait3, wait5));
                        status = ("Setting Amount...");
                        atInterface(905, Child, "Make All");
                    }
                }
            } else if (face == 1) {
                final RSObject furnace = getNearestObjectByID(Furnace);
                if (!isSmelting()) {
                    status = ("Clicking Furnace...");
                    if (!getInterface(916).isValid()) {
                        int ct = 0;
                        if (Smithing == NSmithing) {
                            objects.at(furnace, "Use Steel bar -> Clay forge");
                        } else {
                            objects.at(furnace, "Use Steel bar -> Furnace");
                        }
                        while (!getInterface(916).isValid()) {
                            ct++;
                            if (ct >= 30) {
                                return;
                            }
                            sleep(100);
                        }
                        ct = 0;
                    } else if (getInterface(916).isValid()) {
                        wait(random(wait3, wait5));
                        status = ("Setting Amount...");
                        atInterface(905, Child, "Make All");
                    }
                }

            }
        } else if (makeSet == 1) {
            final RSObject furnace = getNearestObjectByID(Furnace);
            if (!isSmelting()) {
                status = ("Clicking Furnace...");
                if (!getInterface(446).isValid()) {
                    atInventoryItem(Ore1, "Use");
                    int ct = 0;
                    if (Smithing == NSmithing) {
                        objects.at(furnace, "Use " + OreName1 + " -> Clay forge");
                    } else {
                        objects.at(furnace, "Use " + OreName1 + " -> Furnace");
                    }
                    while (!getInterface(916).isValid()) {
                        ct++;
                        if (ct >= 30) {
                            return;
                        }
                        sleep(100);
                    }
                    ct = 0;
                } else if (getInterface(446).getChild(Child).isValid()) {
                    RSInterfaceChild ch = getInterface(446).getChild(Child);
                    atInterface(ch, false);
                    wait(random(wait3, wait5));
                    atMenu("Make All");
                }
            }
        }
    }

    boolean walkToFurnace() {// SETTING PATH TO FURNACE
        if (distanceTo(getDestination()) <= random(8, 12)) {
            if (getInventoryCount(Ore1) > 0
                    && getInventoryCount(Ore2) > 1) {
                status = ("Going To Furnace...");


                try {
                    if (!walkPathMiniM(Smithing, 12, 1, 1)) {
                        walkTo(nextTile(Smithing, 12, false));


                    }
                } catch (final Exception e) {
                }
            }
        }
        return true;


    }

    void logProgressReport() {
        final long runTime = System.currentTimeMillis() - scriptStartTime;
        final int seconds = (int) ((runTime / 1000) % 60);
        final int minutes = (int) ((runTime / 1000) / 60) % 60;
        final int hours = (int) (((runTime / 1000) / 60) / 60) % 60;
        final StringBuilder t1 = new StringBuilder();
        if (hours < 10) {
            t1.append('0');
        }
        t1.append(hours);
        t1.append(" : ");
        if (minutes < 10) {
            t1.append('0');
        }
        t1.append(minutes);
        t1.append(" : ");
        if (seconds < 10) {
            t1.append('0');
        }
        t1.append(seconds);
        log("Thank you for using this script.");
        log("Please visit its page on the Runedev.info site");
        log(properties.name() + ", " + properties.version());
        log("Run Time: " + t1);
        log(ClickName + " Made: " + BarCount);
    }

    public void onRepaint(final Graphics g) {
        if (!isLoggedIn()) {
            g.setColor(new Color(255, 255, 255, 255));
            g.setFont(new Font("arial", Font.BOLD, 12));
            g.drawString("Please Wait Game Is Starting...", 330, 19);


        } else {
            final Mouse m = Bot.getClient().getMouse();


            if (isLoggedIn()) {
                final long runTime = System.currentTimeMillis() - scriptStartTime;
                final int seconds = (int) ((runTime / 1000) % 60);
                final int minutes = (int) ((runTime / 1000) / 60) % 60;
                final int hours = (int) (((runTime / 1000) / 60) / 60) % 60;
                final StringBuilder t1 = new StringBuilder();


                if (hours < 10) {
                    t1.append('0');


                }
                t1.append(hours);
                t1.append(" : ");


                if (minutes < 10) {
                    t1.append('0');


                }
                t1.append(minutes);
                t1.append(" : ");


                if (seconds < 10) {
                    t1.append('0');


                }
                t1.append(seconds);


                int barPerHour = 0;


                int gpPerHour = 0;

                final int xpTilNextS = skills.getXPToNextLevel(STAT_SMITHING);
                final int xpTilNextC = skills.getXPToNextLevel(STAT_CRAFTING);
                final int percentTilNextS = skills.getPercentToNextLevel(STAT_SMITHING);
                final int percentTilNextC = skills.getPercentToNextLevel(STAT_CRAFTING);
                final int fillBarC = (int) (1.40 * (double) percentTilNextC);
                final int fillBarS = (int) (1.40 * (double) percentTilNextS);
                final int gpPhatLoad = BarCount * salesGE - geAmount;


                if ((runTime / 1000) > 0) {
                    barPerHour = (int) ((3600000.0 / (double) runTime) * BarCount);
                    gpPerHour = (int) ((3600000.0 / (double) runTime) * salesGE);


                }
                int a = 7;


                int b = 6;


                if (Theme == 0) {// NO IMAGE ON WITH STAT BOX RIGHT AND NAME BOX LEFT
                    g.setColor(new Color(167, 115, 25, 180));
                    g.drawRoundRect(369, 319, 147, 18, 5, 5);
                    g.setColor(new Color(255, 248, 183, 125));
                    g.fillRoundRect(369, 319, 147, 18, 5, 5);
                    g.setColor(new Color(0, 0, 0, 255));
                    g.setFont(new Font("arial", Font.PLAIN, 10));
                    g.drawString("v " + properties.version(), 480, 314);
                    g.setFont(new Font("arial", Font.PLAIN, 12));
                    g.drawString(status, 372, 331);
                    g.setColor(new Color(167, 115, 25, 180));
                    g.drawRoundRect(4, 319, 147, 18, 5, 5);
                    g.setColor(new Color(255, 248, 183, 125));
                    g.fillRoundRect(4, 319, 147, 18, 5, 5);


                } else if (Theme == 1) {// RS BASIC IMAGE WITH STAT BOX RIGHT AND NAME BOX LEFT
                    g.setColor(new Color(8, 37, 80, 180));
                    g.drawRoundRect(369, 319, 147, 18, 5, 5);
                    g.setColor(new Color(105, 163, 255, 125));
                    g.fillRoundRect(369, 319, 147, 18, 5, 5);
                    g.setColor(new Color(210, 229, 254, 255));
                    g.setFont(new Font("arial", Font.PLAIN, 10));
                    g.drawString("v " + properties.version(), 480, 314);
                    g.setFont(new Font("arial", Font.PLAIN, 12));
                    g.drawString(status, 372, 331);
                    g.setColor(new Color(8, 37, 80, 180));
                    g.drawRoundRect(4, 319, 147, 18, 5, 5);
                    g.setColor(new Color(105, 163, 255, 125));
                    g.fillRoundRect(4, 319, 147, 18, 5, 5);


                } else if (Theme == 2) { // MICRO WINDOW IMAGE WITH STAT BOX RIGHT AND NAME BOX LEFT
                    g.setColor(new Color(0, 0, 0, 255));
                    g.drawRoundRect(369, 319, 147, 18, 5, 5);
                    g.setColor(new Color(198, 198, 198, 125));
                    g.fillRoundRect(369, 319, 147, 18, 5, 5);
                    g.setColor(new Color(0, 0, 0, 255));
                    g.setFont(new Font("arial", Font.PLAIN, 10));
                    g.drawString("v " + properties.version(), 480, 314);
                    g.setFont(new Font("arial", Font.PLAIN, 12));
                    g.drawString(status, 372, 331);
                    g.setColor(new Color(0, 0, 0, 255));
                    g.drawRoundRect(4, 319, 147, 18, 5, 5);
                    g.setColor(new Color(198, 198, 198, 125));
                    g.fillRoundRect(4, 319, 147, 18, 5, 5);


                } else if (Theme == 5) {//  THE BIGHOOF IMAGE WITH STAT BOX RIGHT AND NAME BOX LEFT
                    g.setColor(new Color(167, 115, 25, 180));
                    g.drawRoundRect(369, 319, 147, 18, 5, 5);
                    g.setColor(new Color(255, 248, 183, 125));
                    g.fillRoundRect(369, 319, 147, 18, 5, 5);
                    g.setColor(new Color(0, 0, 0, 255));
                    g.setFont(new Font("arial", Font.PLAIN, 10));
                    g.drawString("v " + properties.version(), 480, 314);
                    g.setFont(new Font("arial", Font.PLAIN, 12));
                    g.drawString(status, 372, 331);
                    g.setColor(new Color(167, 115, 25, 180));
                    g.drawRoundRect(4, 319, 147, 18, 5, 5);
                    g.setColor(new Color(255, 248, 183, 125));
                    g.fillRoundRect(4, 319, 147, 18, 5, 5);


                }
                if (m.getX() > 4 && m.getX() < 151 && m.getY() > 315 && m.getY() < 335) {//MOUSE OVER
                    if (Theme == 0) {//THE BIGHOOF IMAGE WITH BOX THEME
                        g.drawImage(img, 0, 48, null);
                        g.setColor(new Color(167, 115, 25, 180));
                        g.drawRoundRect(4, 133, 147, 205, 5, 5);
                        g.setColor(new Color(255, 248, 183, 125));
                        g.fillRoundRect(4, 133, 147, 187, 5, 5);
                        g.setColor(new Color(0, 0, 0, 255));
                        g.setFont(new Font("sansserif", Font.PLAIN, 12));
                        g.drawString("RunTime: " + t1, a, 149);


                        if (makeSet == 0) {
                            g.drawString("Current Level: " + skills.getCurrSkillLevel(Constants.STAT_SMITHING), a, 167);
                            g.drawString("Levels Gained: " + (skills.getCurrSkillLevel(Constants.STAT_SMITHING) - startLVL), a, 185);


                        } else if (makeSet == 1) {
                            g.drawString("Current Level: " + skills.getCurrSkillLevel(Constants.STAT_CRAFTING), a, 167);
                            g.drawString("Levels Gained: " + (skills.getCurrSkillLevel(Constants.STAT_CRAFTING) - startLVL), a, 185);


                        }
                        g.drawString(BarName + "s: " + BarCount, a, 203);


                        if (makeSet == 0) {
                            g.drawString("Items To Next LVL: " + skills.getXPToNextLevel(STAT_SMITHING) / Barxp, a, 221);


                        } else if (makeSet == 1) {
                            g.drawString("Items To Next LVL: " + skills.getXPToNextLevel(STAT_CRAFTING) / Barxp, a, 221);


                        }
                        g.drawString("Item Per Hour: " + barPerHour, a, 239);
                        g.drawString("GE Value: " + gpPhatLoad + " gp", a, 257);
                        g.drawString("GP Per Hour: " + gpPerHour, a, 275);


                        if (makeSet == 0) {
                            g.drawString("Exp Gain: " + (skills.getCurrentSkillExp(Constants.STAT_SMITHING) - startXP), a, 293);


                        } else if (makeSet == 1) {
                            g.drawString("Exp Gain: " + (skills.getCurrentSkillExp(Constants.STAT_CRAFTING) - startXP), a, 293);


                        }
                        if (makeSet == 0) {
                            g.drawString("Exp To Next LVL: " + xpTilNextS, a, 311);


                        } else if (makeSet == 1) {
                            g.drawString("Exp To Next LVL: " + xpTilNextC, a, 311);


                        }
                        if (makeSet == 0) {
                            g.setColor(new Color(161, 17, 11, 200));
                            g.drawRoundRect(6, 331 - 11, 140, 13, 10, 10);
                            g.setColor(new Color(207, 73, 27, 180));
                            g.fillRoundRect(6, 331 - 11, 140, 13, 10, 10);
                            g.setColor(new Color(85, 45, 3, 200));
                            g.drawRoundRect(6, 331 - 11, fillBarS, 13, 10, 10);
                            g.setColor(new Color(247, 240, 29, 125));
                            g.fillRoundRect(6, 331 - 11, fillBarS, 13, 10, 10);
                            g.setFont(new Font("sansserif", Font.PLAIN, 12));
                            g.setColor(new Color(0, 0, 0, 255));
                            g.drawString(percentTilNextS + "%", 10, 331);


                        } else if (makeSet == 1) {
                            g.setColor(new Color(161, 17, 11, 200));
                            g.drawRoundRect(6, 331 - 11, 140, 13, 10, 10);
                            g.setColor(new Color(207, 73, 27, 180));
                            g.fillRoundRect(6, 331 - 11, 140, 13, 10, 10);
                            g.setColor(new Color(85, 45, 3, 200));
                            g.drawRoundRect(6, 331 - 11, fillBarC, 13, 10, 10);
                            g.setColor(new Color(247, 240, 29, 125));
                            g.fillRoundRect(6, 331 - 11, fillBarC, 13, 10, 10);
                            g.setFont(new Font("sansserif", Font.PLAIN, 12));
                            g.setColor(new Color(0, 0, 0, 255));
                            g.drawString(percentTilNextC + "%", 10, 331);


                        }
                    } else if (Theme == 1) {// RS BASIC IMAGE WITH BOX THEME
                        g.drawImage(img, 0, 127, null);
                        g.setColor(new Color(8, 37, 80, 180));
                        g.drawRoundRect(4, 133, 147, 205, 5, 5);
                        g.setColor(new Color(105, 163, 255, 10));
                        g.fillRoundRect(4, 133, 147, 187, 5, 5);
                        g.setColor(new Color(210, 229, 254, 255));
                        g.setFont(new Font("sansserif", Font.PLAIN, 12));
                        g.drawString("RunTime: " + t1, a, 149);


                        if (makeSet == 0) {
                            g.drawString("Current Level: " + skills.getCurrSkillLevel(Constants.STAT_SMITHING), a, 167);
                            g.drawString("Levels Gained: " + (skills.getCurrSkillLevel(Constants.STAT_SMITHING) - startLVL), a, 185);


                        } else if (makeSet == 1) {
                            g.drawString("Current Level: " + skills.getCurrSkillLevel(Constants.STAT_CRAFTING), a, 167);
                            g.drawString("Levels Gained: " + (skills.getCurrSkillLevel(Constants.STAT_CRAFTING) - startLVL), a, 185);


                        }
                        g.drawString(BarName + "s: " + BarCount, a, 203);


                        if (makeSet == 0) {
                            g.drawString("Items To Next LVL: " + skills.getXPToNextLevel(STAT_SMITHING) / Barxp, a, 221);


                        } else if (makeSet == 1) {
                            g.drawString("Items To Next LVL: " + skills.getXPToNextLevel(STAT_CRAFTING) / Barxp, a, 221);


                        }
                        g.drawString("Item Per Hour: " + barPerHour, a, 239);
                        g.drawString("GE Value: " + gpPhatLoad + " gp", a, 257);
                        g.drawString("GP Per Hour: " + gpPerHour, a, 275);


                        if (makeSet == 0) {
                            g.drawString("Exp Gain: " + (skills.getCurrentSkillExp(Constants.STAT_SMITHING) - startXP), a, 293);


                        } else if (makeSet == 1) {
                            g.drawString("Exp Gain: " + (skills.getCurrentSkillExp(Constants.STAT_CRAFTING) - startXP), a, 293);


                        }
                        if (makeSet == 0) {
                            g.drawString("Exp To Next LVL: " + xpTilNextS, a, 311);


                        } else if (makeSet == 1) {
                            g.drawString("Exp To Next LVL: " + xpTilNextC, a, 311);


                        }
                        if (makeSet == 0) {
                            g.setColor(new Color(8, 37, 80, 180));
                            g.drawRoundRect(6, 331 - 11, 140, 13, 10, 10);
                            g.setColor(new Color(8, 37, 80, 255));
                            g.fillRoundRect(6, 331 - 11, 140, 13, 10, 10);
                            g.setColor(new Color(105, 163, 255, 255));
                            g.drawRoundRect(6, 331 - 11, fillBarS, 13, 10, 10);
                            g.setColor(new Color(178, 210, 254, 255));
                            g.fillRoundRect(6, 331 - 11, fillBarS, 13, 10, 10);
                            g.setFont(new Font("sansserif", Font.PLAIN, 12));
                            g.setColor(new Color(0, 0, 0, 255));
                            g.drawString(percentTilNextS + "%", 10, 331);


                        } else if (makeSet == 1) {
                            g.setColor(new Color(8, 37, 80, 180));
                            g.drawRoundRect(6, 331 - 11, 140, 13, 10, 10);
                            g.setColor(new Color(8, 37, 80, 255));
                            g.fillRoundRect(6, 331 - 11, 140, 13, 10, 10);
                            g.setColor(new Color(105, 163, 255, 255));
                            g.drawRoundRect(6, 331 - 11, fillBarC, 13, 10, 10);
                            g.setColor(new Color(178, 210, 254, 255));
                            g.fillRoundRect(6, 331 - 11, fillBarC, 13, 10, 10);
                            g.setFont(new Font("sansserif", Font.PLAIN, 12));
                            g.setColor(new Color(0, 0, 0, 255));
                            g.drawString(percentTilNextC + "%", 10, 331);


                        }
                    } else if (Theme == 2) {// MICRO WINDOW IMAGE WITH BOX THEME
                        g.drawImage(img, 4, 123, null);
                        g.setColor(new Color(0, 0, 0, 180));
                        g.drawRoundRect(4, 133, 147, 205, 5, 5);
                        g.setColor(new Color(198, 198, 198, 125));
                        g.fillRoundRect(4, 133, 147, 187, 5, 5);
                        g.setColor(new Color(0, 0, 0, 255));
                        g.setFont(new Font("sansserif", Font.PLAIN, 12));
                        g.drawString("RunTime: " + t1, a, 149);


                        if (makeSet == 0) {
                            g.drawString("Current Level: " + skills.getCurrSkillLevel(Constants.STAT_SMITHING), a, 167);
                            g.drawString("Levels Gained: " + (skills.getCurrSkillLevel(Constants.STAT_SMITHING) - startLVL), a, 185);


                        } else if (makeSet == 1) {
                            g.drawString("Current Level: " + skills.getCurrSkillLevel(Constants.STAT_CRAFTING), a, 167);
                            g.drawString("Levels Gained: " + (skills.getCurrSkillLevel(Constants.STAT_CRAFTING) - startLVL), a, 185);


                        }
                        g.drawString(BarName + "s: " + BarCount, a, 203);


                        if (makeSet == 0) {
                            g.drawString("Items To Next LVL: " + skills.getXPToNextLevel(STAT_SMITHING) / Barxp, a, 221);


                        } else if (makeSet == 1) {
                            g.drawString("Items To Next LVL: " + skills.getXPToNextLevel(STAT_CRAFTING) / Barxp, a, 221);


                        }
                        g.drawString("Item Per Hour: " + barPerHour, a, 239);
                        g.drawString("GE Value: " + gpPhatLoad + " gp", a, 257);
                        g.drawString("GP Per Hour: " + gpPerHour, a, 275);


                        if (makeSet == 0) {
                            g.drawString("Exp Gain: " + (skills.getCurrentSkillExp(Constants.STAT_SMITHING) - startXP), a, 293);


                        } else if (makeSet == 1) {
                            g.drawString("Exp Gain: " + (skills.getCurrentSkillExp(Constants.STAT_CRAFTING) - startXP), a, 293);


                        }
                        if (makeSet == 0) {
                            g.drawString("Exp To Next LVL: " + xpTilNextS, a, 311);


                        } else if (makeSet == 1) {
                            g.drawString("Exp To Next LVL: " + xpTilNextC, a, 311);


                        }
                        if (makeSet == 0) {
                            g.setColor(new Color(255, 255, 255, 200));
                            g.drawRoundRect(6, 331 - 11, 140, 13, 10, 10);
                            g.setColor(new Color(0, 0, 0, 180));
                            g.fillRoundRect(6, 331 - 11, 140, 13, 10, 10);
                            g.setColor(new Color(145, 145, 145, 200));
                            g.drawRoundRect(6, 331 - 11, fillBarS, 13, 10, 10);
                            g.setColor(new Color(255, 255, 255, 255));
                            g.fillRoundRect(6, 331 - 11, fillBarS, 13, 10, 10);
                            g.setFont(new Font("sansserif", Font.PLAIN, 12));
                            g.setColor(new Color(0, 0, 0, 255));
                            g.drawString(percentTilNextS + "%", 10, 331);


                        } else if (makeSet == 1) {
                            g.setColor(new Color(255, 255, 255, 200));
                            g.drawRoundRect(6, 331 - 11, 140, 13, 10, 10);
                            g.setColor(new Color(0, 0, 0, 180));
                            g.fillRoundRect(6, 331 - 11, 140, 13, 10, 10);
                            g.setColor(new Color(145, 145, 145, 200));
                            g.drawRoundRect(6, 331 - 11, fillBarC, 13, 10, 10);
                            g.setColor(new Color(255, 255, 255, 255));
                            g.fillRoundRect(6, 331 - 11, fillBarC, 13, 10, 10);
                            g.setFont(new Font("sansserif", Font.PLAIN, 12));
                            g.setColor(new Color(0, 0, 0, 255));
                            g.drawString(percentTilNextC + "%", 10, 331);


                        }

                    } else if (Theme == 5) {// THE BIG BOMB IMAGE WITH BOX THEME
                        g.drawImage(img, 4, 107, null);
                        g.setColor(new Color(167, 115, 25, 180));
                        g.drawRoundRect(4, 133, 147, 205, 5, 5);
                        g.setColor(new Color(255, 248, 183, 125));
                        g.fillRoundRect(4, 133, 147, 187, 5, 5);
                        g.setColor(new Color(0, 0, 0, 255));
                        g.setFont(new Font("sansserif", Font.PLAIN, 12));
                        g.drawString("RunTime: " + t1, a, 149);


                        if (makeSet == 0) {
                            g.drawString("Current Level: " + skills.getCurrSkillLevel(Constants.STAT_SMITHING), a, 167);
                            g.drawString("Levels Gained: " + (skills.getCurrSkillLevel(Constants.STAT_SMITHING) - startLVL), a, 185);


                        } else if (makeSet == 1) {
                            g.drawString("Current Level: " + skills.getCurrSkillLevel(Constants.STAT_CRAFTING), a, 167);
                            g.drawString("Levels Gained: " + (skills.getCurrSkillLevel(Constants.STAT_CRAFTING) - startLVL), a, 185);


                        }
                        g.drawString(BarName + "s: " + BarCount, a, 203);


                        if (makeSet == 0) {
                            g.drawString("Items To Next LVL: " + skills.getXPToNextLevel(STAT_SMITHING) / Barxp, a, 221);


                        } else if (makeSet == 1) {
                            g.drawString("Items To Next LVL: " + skills.getXPToNextLevel(STAT_CRAFTING) / Barxp, a, 221);


                        }
                        g.drawString("Item Per Hour: " + barPerHour, a, 239);
                        g.drawString("GE Value: " + gpPhatLoad + " gp", a, 257);
                        g.drawString("GP Per Hour: " + gpPerHour, a, 275);


                        if (makeSet == 0) {
                            g.drawString("Exp Gain: " + (skills.getCurrentSkillExp(Constants.STAT_SMITHING) - startXP), a, 293);


                        } else if (makeSet == 1) {
                            g.drawString("Exp Gain: " + (skills.getCurrentSkillExp(Constants.STAT_CRAFTING) - startXP), a, 293);


                        }
                        if (makeSet == 0) {
                            g.drawString("Exp To Next LVL: " + xpTilNextS, a, 311);


                        } else if (makeSet == 1) {
                            g.drawString("Exp To Next LVL: " + xpTilNextC, a, 311);


                        }
                        if (makeSet == 0) {
                            g.setColor(new Color(255, 255, 255, 255));
                            g.drawRoundRect(6, 331 - 11, 140, 13, 10, 10);
                            g.setColor(new Color(0, 0, 0, 180));
                            g.fillRoundRect(6, 331 - 11, 140, 13, 10, 10);
                            g.setColor(new Color(255, 255, 255, 255));
                            g.drawRoundRect(6, 331 - 11, fillBarS, 13, 10, 10);
                            g.setColor(new Color(243, 208, 13, 255));
                            g.fillRoundRect(6, 331 - 11, fillBarS, 13, 10, 10);
                            g.setFont(new Font("sansserif", Font.PLAIN, 12));
                            g.setColor(new Color(0, 0, 0, 255));
                            g.drawString(percentTilNextS + "%", 10, 331);


                        } else if (makeSet == 1) {
                            g.setColor(new Color(255, 255, 255, 255));
                            g.drawRoundRect(6, 331 - 11, 140, 13, 10, 10);
                            g.setColor(new Color(0, 0, 0, 180));
                            g.fillRoundRect(6, 331 - 11, 140, 13, 10, 10);
                            g.setColor(new Color(255, 255, 255, 255));
                            g.drawRoundRect(6, 331 - 11, fillBarC, 13, 10, 10);
                            g.setColor(new Color(243, 208, 13, 255));
                            g.fillRoundRect(6, 331 - 11, fillBarC, 13, 10, 10);
                            g.setFont(new Font("sansserif", Font.PLAIN, 12));
                            g.setColor(new Color(0, 0, 0, 255));
                            g.drawString(percentTilNextC + "%", 10, 331);


                        }
                    } else if (Theme == 6) {// RUST-OLIUM IMAGE WITH BOX THEME
                        g.drawImage(img, 0, 100, null);
                        g.setColor(new Color(255, 248, 183, 0));
                        g.fillRoundRect(4, 133, 147, 187, 5, 5);
                        g.setFont(new Font("sansserif", Font.PLAIN, 12));
                        g.setColor(new Color(255, 255, 255, 255));
                        g.drawString("RunTime: " + t1, a, 149);


                        if (makeSet == 0) {
                            g.drawString("Current Level: " + skills.getCurrSkillLevel(Constants.STAT_SMITHING), a, 167);
                            g.drawString("Levels Gained: " + (skills.getCurrSkillLevel(Constants.STAT_SMITHING) - startLVL), a, 185);


                        } else if (makeSet == 1) {
                            g.drawString("Current Level: " + skills.getCurrSkillLevel(Constants.STAT_CRAFTING), a, 167);
                            g.drawString("Levels Gained: " + (skills.getCurrSkillLevel(Constants.STAT_CRAFTING) - startLVL), a, 185);


                        }
                        g.drawString(BarName + "s: " + BarCount, a, 203);


                        if (makeSet == 0) {
                            g.drawString("Items To Next LVL: " + skills.getXPToNextLevel(STAT_SMITHING) / Barxp, a, 221);


                        } else if (makeSet == 1) {
                            g.drawString("Items To Next LVL: " + skills.getXPToNextLevel(STAT_CRAFTING) / Barxp, a, 221);


                        }
                        g.drawString("Item Per Hour: " + barPerHour, a, 239);
                        g.drawString("GE Value: " + gpPhatLoad + " gp", a, 257);
                        g.drawString("GP Per Hour: " + gpPerHour, a, 275);


                        if (makeSet == 0) {
                            g.drawString("Exp Gain: " + (skills.getCurrentSkillExp(Constants.STAT_SMITHING) - startXP), a, 293);


                        } else if (makeSet == 1) {
                            g.drawString("Exp Gain: " + (skills.getCurrentSkillExp(Constants.STAT_CRAFTING) - startXP), a, 293);


                        }
                        if (makeSet == 0) {
                            g.drawString("Exp To Next LVL: " + xpTilNextS, a, 311);


                        } else if (makeSet == 1) {
                            g.drawString("Exp To Next LVL: " + xpTilNextC, a, 311);


                        }
                        if (makeSet == 0) {
                            g.setColor(new Color(247, 240, 29, 225));
                            g.fillRoundRect(6, 331 - 11, fillBarS, 13, 8, 8);
                            g.setFont(new Font("sansserif", Font.PLAIN, 12));
                            g.setColor(new Color(20, 50, 200, 255));
                            g.drawString(percentTilNextS + "%", 10, 331);


                        } else if (makeSet == 1) {
                            g.setColor(new Color(247, 240, 29, 225));
                            g.fillRoundRect(6, 331 - 11, fillBarC, 13, 8, 8);
                            g.setFont(new Font("sansserif", Font.PLAIN, 12));
                            g.setColor(new Color(20, 50, 200, 255));
                            g.drawString(percentTilNextC + "%", 10, 331);


                        }

                    }
                } else {// SCRIPT NAME AND VERSION TEXT
                    if (Theme == 0) {
                        g.setColor(new Color(247, 240, 29, 125));
                        g.setFont(new Font("arial", Font.BOLD, 12));
                        g.drawString(properties.name(), 6, 332);
                        g.setColor(new Color(207, 73, 27, 255));
                        g.drawString(properties.name(), a, 331);


                    } else if (Theme == 1) {
                        g.setColor(new Color(105, 163, 255, 125));
                        g.setFont(new Font("arial", Font.BOLD, 12));
                        g.drawString(properties.name(), b, 332);
                        g.setColor(new Color(8, 37, 80, 255));
                        g.drawString(properties.name(), a, 331);


                    } else if (Theme == 2) {
                        g.setColor(new Color(255, 255, 255, 125));
                        g.setFont(new Font("arial", Font.BOLD, 12));
                        g.drawString(properties.name(), b, 332);
                        g.setColor(new Color(0, 0, 0, 255));
                        g.drawString(properties.name(), a, 331);


                    } else if (Theme == 5) {
                        g.setColor(new Color(255, 255, 255, 125));
                        g.setFont(new Font("arial", Font.BOLD, 12));
                        g.drawString(properties.name(), b, 332);
                        g.setColor(new Color(0, 0, 0, 255));
                        g.drawString(properties.name(), a, 331);


                    } else if (Theme == 6) {
                        g.setColor(new Color(0, 0, 0, 125));
                        g.setFont(new Font("arial", Font.BOLD, 12));
                        g.drawString(properties.name(), b, 332);
                        g.setColor(new Color(255, 255, 255, 255));
                        g.drawString(properties.name(), a, 331);


                    }
                }
            }
        }
    }

    @Override
    public boolean onStart(final Map<String, String> args) {
        if (getInterface(378).isValid()) {
        }

        if (args.get("theme").equals("None")) {
            Theme = 0;


        } else if (args.get("theme").equals("RS Basic")) {
            Theme = 1;


            try {
                final URL url = new URL("http://bighoofscripts.webs.com/images/aiof/theme1.png");
                img = ImageIO.read(url);


            } catch (final IOException e) {
                e.printStackTrace();


            }
        } else if (args.get("theme").equals("Micro Window")) {
            Theme = 2;


            try {
                final URL url = new URL("http://bighoofscripts.webs.com/images/aiof/theme4.png");
                img = ImageIO.read(url);


            } catch (final IOException e) {
                e.printStackTrace();


            }
        } else if (args.get("theme").equals("The Bigbomb")) {
            Theme = 5;


            try {
                final URL url = new URL("http://bighoofscripts.webs.com/images/aiof/theme5.png");
                img = ImageIO.read(url);


            } catch (final IOException e) {
                e.printStackTrace();


            }
        } else if (args.get("theme").equals("Rustolium")) {
            Theme = 6;


            try {
                final URL url = new URL("http://bighoofscripts.webs.com/images/aiof/theme1031.png");
                img = ImageIO.read(url);


            } catch (final IOException e) {
                e.printStackTrace();


            }
        }

        if (args.get("location").equals("Falador")) {
            Smithing = FSmithing;
            Banking = FBanking;
            BankBooth = 11758;
            Furnace = 11666;


        } else if (args.get("location").equals("Al Kharid")) {
            Smithing = ASmithing;
            Banking = ABanking;
            BankBooth = 35647;
            Furnace = 11666;


        } else if (args.get("location").equals("Edgeville")) {
            Smithing = ESmithing;
            Banking = EBanking;
            BankBooth = 26972;
            Furnace = 26814;


        } else if (args.get("location").equals("Port Phasmatys")) {
            Smithing = PSmithing;
            Banking = PBanking;
            BankBooth = 35647;
            Furnace = 11666;


        } else if (args.get("location").equals("Neitiznot")) {
            Smithing = NSmithing;
            Banking = NBanking;
            BankBooth = 21301;
            Furnace = 21303;


        }

        if (args.get("stype").equals("Bronze Bar")) {
            BarName = "Bronze Bar";
            ClickName = "Bronze";
            OreName1 = "Copper ore";
            OreName2 = "Tin";
            BarID = 2349;
            Barxp = (int) (B1);
            makeSet = 0;
            madeID = 2349;
            Ore1 = 436;
            Ore2 = 438;
            Ore1Amount = 14;
            Ore2Amount = 14;
            Child = 14;
            BarAmount = 28;


        } else if (args.get("stype").equals("Blurite Bar")) {
            BarName = "Blurite Bar";
            ClickName = "Blurite";
            OreName1 = "blurite ore";
            OreName2 = "blurite";
            BarID = 9467;
            Barxp = (int) (B0);
            makeSet = 0;
            madeID = 9467;
            Ore1 = 668;
            Ore2 = 668;
            Ore1Amount = 28;
            Ore2Amount = 0;
            Child = 15;
            BarAmount = 28;


        } else if (args.get("stype").equals("Iron Bar")) {
            BarName = "Iron Bar";
            ClickName = "Iron";
            OreName1 = "Iron ore";
            OreName2 = "Iron";
            BarID = 2351;
            Barxp = (int) (B2);
            makeSet = 0;
            madeID = 2351;
            Ore1 = 440;
            Ore2 = 440;
            Ore1Amount = 28;
            Ore2Amount = 0;
            Child = 16;
            BarAmount = 28;


        } else if (args.get("stype").equals("Silver Bar")) {
            BarName = "Silver Bar";
            ClickName = "Silver";
            OreName1 = "Silver ore";
            OreName2 = "Silver";
            BarID = 2355;
            Barxp = (int) (B3);
            makeSet = 0;
            madeID = 2355;
            Ore1 = 442;
            Ore2 = 442;
            Ore1Amount = 28;
            Ore2Amount = 0;
            Child = 17;
            BarAmount = 28;


        } else if (args.get("stype").equals("Steel Bar")) {
            BarName = "Steel Bar";
            ClickName = "Steel";
            OreName1 = "Iron ore";
            OreName2 = "Coal";
            BarID = 2353;
            Barxp = (int) (B4);
            makeSet = 0;
            madeID = 2353;
            Ore1 = 440;
            Ore2 = 453;
            Ore1Amount = 9;
            Ore2Amount = 18;
            Child = 18;
            BarAmount = 9;


        } else if (args.get("stype").equals("Gold Bar")) {
            BarName = "Gold Bar";
            ClickName = "Gold";
            OreName1 = "Gold ore";
            OreName2 = "Gold";
            BarID = 2357;
            makeSet = 0;
            madeID = 2357;
            Ore1 = 444;
            Ore2 = 444;
            Ore1Amount = 28;
            Ore2Amount = 0;
            Child = 19;
            BarAmount = 28;


            if (args.get("goldGloves") != null) {
                Barxp = (int) (B51);


            } else {
                Barxp = (int) (B5);


            }
        } else if (args.get("stype").equals("Mithril Bar")) {
            BarName = "Mithril Bar";
            ClickName = "Mithril";
            OreName1 = "Mithril ore";
            OreName2 = "Coal";
            BarID = 2359;
            Barxp = (int) (B6);
            makeSet = 0;
            madeID = 2357;
            Ore1 = 447;
            Ore2 = 453;
            Ore1Amount = 5;
            Ore2Amount = 20;
            Child = 20;
            BarAmount = 5;


        } else if (args.get("stype").equals("Adamantite Bar")) {
            BarName = "Adamantite Bar";
            ClickName = "Adamantite";
            OreName1 = "Adamantite ore";
            OreName2 = "Coal";
            BarID = 2361;
            Barxp = (int) (B7);
            makeSet = 0;
            madeID = 2361;
            Ore1 = 449;
            Ore2 = 453;
            Ore1Amount = 4;
            Ore2Amount = 24;
            Child = 21;
            BarAmount = 4;


        } else if (args.get("stype").equals("Runite Bar")) {
            BarName = "Runite Bar";
            ClickName = "Runite";
            OreName1 = "Runite ore";
            OreName2 = "Coal";
            BarID = 2363;
            Barxp = (int) (B8);
            makeSet = 0;
            madeID = 2363;
            Ore1 = 451;
            Ore2 = 453;
            Ore1Amount = 3;
            Ore2Amount = 24;
            Child = 22;
            BarAmount = 3;


        } else if (args.get("stype").equals("Cannon Ball")) {
            BarName = "CannonBall";
            OreName1 = "Steel Bar";
            OreName2 = "Steel Bar";
            ClickName = "Cannon Ball";
            BarID = 2;
            Barxp = (int) (B10);
            makeSet = 0;
            madeID = 2;
            Ore1 = 2353;
            Ore2 = 2353;
            Ore1Amount = 27;
            Ore2Amount = 0;
            face = 1;
            mouldName = "Cannon Ball";
            mould = 1;
            mouldID = 4;
            X = 260;
            Y = 410;
            Child = 14;
            BarAmount = 108;


        }

        if (args.get("ctype").equals("Gold Ring")) {
            BarName = "Gld Ring";
            ClickName = "Gold Ring";
            OreName1 = "Gold bar";
            Barxp = (int) (B01);
            makeSet = 1;
            madeID = 1635;
            Ore1 = 2357;
            Ore2 = 2357;
            Ore1Amount = 27;
            Ore2Amount = 0;
            Child = 82;
            mouldName = "Ring";
            mouldID = 1592;
            mould = 1;
            X = 116;
            Y = 105;
            BarAmount = 27;


        } else if (args.get("ctype").equals("Sapphire Ring")) {
            BarName = "Sap Ring";
            ClickName = "Sapphire Ring";
            OreName1 = "Gold bar";
            OreName2 = "Sapphire";
            Barxp = (int) (B04);
            makeSet = 1;
            madeID = 1637;
            Ore1 = 2357;
            Ore2 = 1607;
            Ore1Amount = 13;
            Ore2Amount = 13;
            Child = 84;
            mouldName = "Ring";
            mouldID = 1592;
            mould = 1;
            X = 165;
            Y = 105;
            BarAmount = 13;


        } else if (args.get("ctype").equals("Emerald Ring")) {
            BarName = "Em Ring";
            ClickName = "Emerald Ring";
            OreName1 = "Gold bar";
            OreName2 = "Emerald";
            Barxp = (int) (B05);
            makeSet = 1;
            madeID = 1639;
            Ore1 = 2357;
            Ore2 = 1605;
            Ore1Amount = 13;
            Ore2Amount = 13;
            Child = 86;
            mouldName = "Ring";
            mouldID = 1592;
            mould = 1;
            X = 210;
            Y = 105;
            BarAmount = 13;


        } else if (args.get("ctype").equals("Ruby Ring")) {
            BarName = "Rby Ring";
            ClickName = "Ruby Ring";
            OreName1 = "Gold bar";
            OreName2 = "Ruby";
            Barxp = (int) (B08);
            makeSet = 1;
            madeID = 1641;
            Ore1 = 2357;
            Ore2 = 1603;
            Ore1Amount = 13;
            Ore2Amount = 13;
            Child = 88;
            mouldName = "Ring";
            mouldID = 1592;
            mould = 1;
            X = 255;
            Y = 105;
            BarAmount = 13;


        } else if (args.get("ctype").equals("Diamond Ring")) {
            BarName = "Dim Ring";
            ClickName = "Diamond Ring";
            OreName1 = "Gold bar";
            OreName2 = "Diamond";
            Barxp = (int) (B011);
            makeSet = 1;
            madeID = 1643;
            Ore1 = 2357;
            Ore2 = 1601;
            Ore1Amount = 13;
            Ore2Amount = 13;
            Child = 90;
            mouldName = "Ring";
            mouldID = 1592;
            mould = 1;
            X = 300;
            Y = 105;
            BarAmount = 13;


        } else if (args.get("ctype").equals("Dragonstone Ring")) {
            BarName = "Dstn Ring";
            ClickName = "Dragonstone Ring";
            OreName1 = "Gold bar";
            OreName2 = "Dragonstone";
            Barxp = (int) (B014);
            makeSet = 1;
            madeID = 1645;
            Ore1 = 2357;
            Ore2 = 1615;
            Ore1Amount = 13;
            Ore2Amount = 13;
            Child = 92;
            mouldName = "Ring";
            mouldID = 1592;
            mould = 1;
            X = 345;
            Y = 105;
            BarAmount = 13;


        } else if (args.get("ctype").equals("Gold Necklace")) {
            BarName = "Gld Neck";
            ClickName = "Gold Necklace";
            OreName1 = "Gold bar";
            Barxp = (int) (B02);
            makeSet = 1;
            madeID = 1654;
            Ore1 = 2357;
            Ore2 = 2357;
            Ore1Amount = 27;
            Ore2Amount = 0;
            Child = 68;
            mouldName = "Necklace";
            mouldID = 1597;
            mould = 1;
            X = 130;
            Y = 175;
            BarAmount = 27;


        } else if (args.get("ctype").equals("Sapphire Necklace")) {
            BarName = "Sap Neck";
            ClickName = "Sapphire Necklace";
            OreName1 = "Gold bar";
            OreName2 = "Sapphire";
            Barxp = (int) (B05);
            makeSet = 1;
            madeID = 1656;
            Ore1 = 2357;
            Ore2 = 1607;
            Ore1Amount = 13;
            Ore2Amount = 13;
            Child = 70;
            mouldName = "Necklace";
            mouldID = 1597;
            mould = 1;
            X = 180;
            Y = 175;
            BarAmount = 13;


        } else if (args.get("ctype").equals("Emerald Necklace")) {
            BarName = "Em Neck";
            ClickName = "Emerald Necklace";
            OreName1 = "Gold bar";
            OreName2 = "Emerald";
            Barxp = (int) (B06);
            makeSet = 1;
            madeID = 1658;
            Ore1 = 2357;
            Ore2 = 1605;
            Ore1Amount = 13;
            Ore2Amount = 13;
            Child = 72;
            mouldName = "Necklace";
            mouldID = 1597;
            mould = 1;
            X = 230;
            Y = 175;
            BarAmount = 13;


        } else if (args.get("ctype").equals("Ruby Necklace")) {
            BarName = "Rby Neck";
            ClickName = "Ruby Necklace";
            OreName1 = "Gold bar";
            OreName2 = "Ruby";
            Barxp = (int) (B09);
            makeSet = 1;
            madeID = 1660;
            Ore1 = 2357;
            Ore2 = 1603;
            Ore1Amount = 13;
            Ore2Amount = 13;
            Child = 74;
            mouldName = "Necklace";
            mouldID = 1597;
            mould = 1;
            X = 280;
            Y = 175;
            BarAmount = 13;


        } else if (args.get("ctype").equals("Diamond Necklace")) {
            BarName = "Dim Neck";
            ClickName = "Diamond Necklace";
            OreName1 = "Gold bar";
            OreName2 = "Diamond";
            Barxp = (int) (B012);
            makeSet = 1;
            madeID = 1662;
            Ore1 = 2357;
            Ore2 = 1601;
            Ore1Amount = 13;
            Ore2Amount = 13;
            Child = 76;
            mouldName = "Necklace";
            mouldID = 1597;
            mould = 1;
            X = 330;
            Y = 175;
            BarAmount = 13;


        } else if (args.get("ctype").equals("Dragonstone Necklace")) {
            BarName = "Dstn Neck";
            ClickName = "Dragonstone Necklace";
            OreName1 = "Gold bar";
            OreName2 = "Dragonstone";
            Barxp = (int) (B015);
            makeSet = 1;
            madeID = 1664;
            Ore1 = 2357;
            Ore2 = 1615;
            Ore1Amount = 13;
            Ore2Amount = 13;
            Child = 78;
            mouldName = "Necklace";
            mouldID = 1597;
            mould = 1;
            X = 380;
            Y = 175;
            BarAmount = 13;


        } else if (args.get("ctype").equals("Gold Amulet")) {
            BarName = "Gld Amulet";
            ClickName = "Gold Amulet";
            OreName1 = "Gold bar";
            Barxp = (int) (B6);
            makeSet = 1;
            madeID = 1673;
            Ore1 = 2357;
            Ore2 = 2357;
            Ore1Amount = 27;
            Ore2Amount = 0;
            Child = 53;
            mouldName = "Amulet";
            mouldID = 1595;
            mould = 1;
            X = 130;
            Y = 227;
            BarAmount = 27;


        } else if (args.get("ctype").equals("Sapphire Amulet")) {
            BarName = "Sap Amulet";
            ClickName = "Sapphire Amulet";
            OreName1 = "Gold bar";
            OreName2 = "Sapphire";
            Barxp = (int) (B07);
            makeSet = 1;
            madeID = 1675;
            Ore1 = 2357;
            Ore2 = 1607;
            Ore1Amount = 13;
            Ore2Amount = 13;
            Child = 55;
            mouldName = "Amulet";
            mouldID = 1595;
            mould = 1;
            X = 180;
            Y = 227;
            BarAmount = 13;


        } else if (args.get("ctype").equals("Emerald Amulet")) {
            BarName = "Em Amulet";
            ClickName = "Emerald Amulet";
            OreName1 = "Gold bar";
            OreName2 = "Emerald";
            Barxp = (int) (B08);
            makeSet = 1;
            madeID = 1677;
            Ore1 = 2357;
            Ore2 = 1605;
            Ore1Amount = 13;
            Ore2Amount = 13;
            Child = 57;
            mouldName = "Amulet";
            mouldID = 1595;
            mould = 1;
            X = 230;
            Y = 227;
            BarAmount = 13;


        } else if (args.get("ctype").equals("Ruby Amulet")) {
            BarName = "Rby Amulet";
            ClickName = "Ruby Amulet";
            OreName1 = "Gold bar";
            OreName2 = "Ruby";
            Barxp = (int) (B011);
            makeSet = 1;
            madeID = 1679;
            Ore1 = 2357;
            Ore2 = 1603;
            Ore1Amount = 13;
            Ore2Amount = 13;
            Child = 59;
            mouldName = "Amulet";
            mouldID = 1595;
            mould = 1;
            X = 280;
            Y = 227;
            BarAmount = 13;


        } else if (args.get("ctype").equals("Diamond Amulet")) {
            BarName = "Dim Amulet";
            ClickName = "Diamond Amulet";
            OreName1 = "Gold bar";
            OreName2 = "Diamond";
            Barxp = (int) (B014);
            makeSet = 1;
            madeID = 1681;
            Ore1 = 2357;
            Ore2 = 1601;
            Ore1Amount = 13;
            Ore2Amount = 13;
            Child = 61;
            mouldName = "Amulet";
            mouldID = 1595;
            mould = 1;
            X = 330;
            Y = 227;
            BarAmount = 13;


        } else if (args.get("ctype").equals("Dragonstone Amulet")) {
            BarName = "Dstn Amulet";
            ClickName = "Dragonstone Amulet";
            OreName1 = "Gold bar";
            OreName2 = "Dragonstone";
            Barxp = (int) (B017);
            makeSet = 1;
            madeID = 1683;
            Ore1 = 2357;
            Ore2 = 1615;
            Ore1Amount = 13;
            Ore2Amount = 13;
            Child = 63;
            mouldName = "Amulet";
            mouldID = 1595;
            mould = 1;
            X = 380;
            Y = 227;
            BarAmount = 13;


        } else if (args.get("ctype").equals("Gold Bracelet")) {
            BarName = "Gld Brace";
            ClickName = "Gold Bracelet";
            Ore1 = 2357;
            Ore2 = 2357;
            OreName1 = "Gold bar";
            Barxp = (int) (B03);
            makeSet = 1;
            madeID = 11069;
            Ore1Amount = 27;
            Ore2Amount = 0;
            Child = 33;
            mouldName = "Bracelet";
            mouldID = 11065;
            mould = 1;
            X = 130;
            Y = 287;
            BarAmount = 27;


        } else if (args.get("ctype").equals("Sapphire Bracelet")) {
            BarName = "Sap Brace";
            ClickName = "Sapphire Bracelet";
            OreName1 = "Gold bar";
            OreName2 = "Sapphire";
            Barxp = (int) (B06);
            makeSet = 1;
            madeID = 11072;
            Ore1 = 2357;
            Ore2 = 1607;
            Ore1Amount = 13;
            Ore2Amount = 13;
            Child = 35;
            mouldName = "Bracelet";
            mouldID = 11065;
            mould = 1;
            X = 180;
            Y = 287;
            BarAmount = 13;


        } else if (args.get("ctype").equals("Emerald Bracelet")) {
            BarName = "Em Brace";
            ClickName = "Emerald Bracelet";
            OreName1 = "Gold bar";
            OreName2 = "Emerald";
            Barxp = (int) (B07);
            makeSet = 1;
            madeID = 11076;
            Ore1 = 2357;
            Ore2 = 1605;
            Ore1Amount = 13;
            Ore2Amount = 13;
            Child = 37;
            mouldName = "Bracelet";
            mouldID = 11065;
            mould = 1;
            X = 230;
            Y = 287;
            BarAmount = 13;


        } else if (args.get("ctype").equals("Ruby Bracelet")) {
            BarName = "Rby Brace";
            ClickName = "Ruby Bracelet";
            OreName1 = "Gold bar";
            OreName2 = "Ruby";
            Barxp = (int) (B010);
            makeSet = 1;
            madeID = 11085;
            Ore1 = 2357;
            Ore2 = 1603;
            Ore1Amount = 13;
            Ore2Amount = 13;
            Child = 39;
            mouldName = "Bracelet";
            mouldID = 11065;
            mould = 1;
            X = 280;
            Y = 287;
            BarAmount = 13;


        } else if (args.get("ctype").equals("Diamond Bracelet")) {
            BarName = "Dim Brace";
            ClickName = "Diamond Bracelet";
            OreName1 = "Gold bar";
            OreName2 = "Diamond";
            Barxp = (int) (B013);
            makeSet = 1;
            madeID = 11092;
            Ore1 = 2357;
            Ore2 = 1601;
            Ore1Amount = 13;
            Ore2Amount = 13;
            Child = 41;
            mouldName = "Bracelet";
            mouldID = 11065;
            mould = 1;
            X = 230;
            Y = 287;
            BarAmount = 13;


        } else if (args.get("ctype").equals("Dragonstone Bracelet")) {
            BarName = "Dstn Brace";
            ClickName = "Bracelet";
            OreName1 = "Gold bar";
            OreName2 = "Dragonstone";
            Barxp = (int) (B016);
            makeSet = 1;
            madeID = 11115;
            Ore1 = 2357;
            Ore2 = 1615;
            Ore1Amount = 13;
            Ore2Amount = 13;
            Child = 43;
            mouldName = "Bracelet";
            mouldID = 11065;
            mould = 1;
            X = 280;
            Y = 287;
            BarAmount = 13;


        } else if (args.get("ctype").equals("Unstrung Symbol")) {
            BarName = "UnS Symbol";
            ClickName = "Unstrung Symbol";
            OreName1 = "Silver Bar";
            Barxp = (int) (B8);
            makeSet = 1;
            madeID = 1714;
            Ore1 = 2355;
            Ore2 = 2355;
            Ore1Amount = 27;
            Ore2Amount = 0;
            Child = 0;
            mouldName = "Symbol";
            mouldID = 1599;
            mould = 1;
            X = 90;
            Y = 120;
            BarAmount = 27;


        } else if (args.get("ctype").equals("Tiara")) {
            BarName = "Tiara";
            ClickName = "Tiara";
            OreName1 = "Silver Bar";
            Barxp = (int) (B022);
            makeSet = 1;
            madeID = 5525;
            Ore1 = 2355;
            Ore2 = 2355;
            Ore1Amount = 27;
            Ore2Amount = 0;
            Child = 0;
            mouldName = "Tiara";
            mouldID = 5523;
            mould = 1;
            X = 260;
            Y = 120;
            BarAmount = 27;


        } else if (args.get("ctype").equals("Sickle")) {
            BarName = "Sickle";
            ClickName = "Sickle";
            OreName1 = "Silver Bar";
            Barxp = (int) (B8);
            makeSet = 1;
            madeID = 2961;
            Ore1 = 2355;
            Ore2 = 2355;
            Ore1Amount = 27;
            Ore2Amount = 0;
            Child = 0;
            mouldName = "Sickle";
            mouldID = 2976;
            mould = 1;
            X = 175;
            Y = 120;
            BarAmount = 27;


        } else if (args.get("ctype").equals("Silver Bolts (unf)")) {
            BarName = "SBolts";
            ClickName = "Silver Bolts (unf)";
            OreName1 = "Silver Bar";
            Barxp = (int) (B8);
            makeSet = 1;
            madeID = 9382;
            Ore1 = 2355;
            Ore2 = 2355;
            Ore1Amount = 27;
            Ore2Amount = 0;
            Child = 0;
            mouldName = "Bolt";
            mouldID = 9434;
            mould = 1;
            X = 340;
            Y = 240;
            BarAmount = 270;


        }

        amount = Integer.parseInt(args.get("amount"));


        if (args.get("restSet") != null) {
            restSet = 1;


        }

        if (args.get("speed").equals("Fast")) {
            spee = random(6, 8);


        } else if (args.get("speed").equals("Human")) {
            spee = random(7, 9);


        } else if (args.get("speed").equals("Slow")) {
            spee = random(8, 10);


        }

        if (args.get("wait").equals("Fast")) {
            wait2 = 25;
            wait3 = 60;
            wait4 = 140;
            wait5 = 240;
            wait6 = 440;
            wait7 = 740;
            wait8 = 940;
            wait9 = 1140;
            wait10 = 1940;


        } else if (args.get("wait").equals("Human")) {
            wait2 = 35;
            wait3 = 75;
            wait4 = 150;
            wait5 = 250;
            wait6 = 450;
            wait7 = 750;
            wait8 = 950;
            wait9 = 1150;
            wait10 = 1950;


        } else if (args.get("wait").equals("Slow")) {
            wait2 = 50;
            wait3 = 100;
            wait4 = 200;
            wait5 = 300;
            wait6 = 500;
            wait7 = 800;
            wait8 = 1000;
            wait9 = 1200;
            wait10 = 2000;


        }

        scriptStartTime = System.currentTimeMillis();

        salesGE = ge.loadItemInfo(madeID).getPrice();



        return true;

    }
}
